Dynomotion

Group: DynoMotion Message: 7327 From: tapiolarikka Date: 4/26/2013
Subject: KMotion/Mach3 compatibility Question?
Hi Tom!

I have Kmotion 431C installed and I'm having odd problems with
Mach3 R3.042.040.

Today I got KFlop twice so corrupted that I had to start from beginning by Flashing new firmware. It appears that if Kflop is not powered up when Mach tries to init, something gets so messed up that have to terminate mach with task manager and reboot in order to try again.

Which KMotion/Plug in I should use with:
- Mach 042.040?
- Mach 043.022?

Which Mach3 version should be used with KFlop 431C?

As to the odd problems:

I have 2500ppr encoders with 1:3 reduction and 5mm/rev lead screws on XYZ. I calculate this to be 6000steps/mm on Mach motor tuning but 5920 to 5980steps/mm results in correctly measured move

A-axis/Spindle is angular and has 2560ppr/rev and 1:1 belt.
I calculate 2560*4/360=28,44444 but testing gives between 37 and 38 to be correct.

Any ideas what might be the cause and cure for this?


After getting the axis moving correctly I tried "SpindleMach3Jog.c".

What should be entered in the plugin config for encoder counts? Encoder ppr or ppr*4?

With 2560 counts/rev and following code:

#include "KMotionDef.h"

//Plugin Notifications and defines..
enum { EX_DDA , EX_VMS, EX_COMMAND, EX_SPINON, EX_SPINOFF, EX_SPINSPEED, EX_MOTORTUNED
, EX_SETUP, EX_FEEDHOLD, EX_RUN, EX_ESTOP , EX_CONFIG };

#define SPINDLE_AXIS 3 // axis set up as Spindle, possibly Step/Dir or Servo
#define FACTOR 10240.0 // Converts fractional pulley speed to counts/sec (may be negative)

main()
{
int message = persist.UserData[0]; // Mach3 message ID
int Direction = persist.UserData[1]; // Mach3 Spindle Direction
float speed = *(float *)&persist.UserData[2]; // value stored is actually a float
int DirFactor = 1;

if (Direction==0) DirFactor=-1; // change Direcion 0 or 1 to DirFactor -1 or +1


printf("Mach3 Notify Message=%d, Direction=%2d, Spindle Set to %f\n",message,Direction,speed);

switch (message)
{
case EX_SPINSPEED:
printf("Spindle Speed Set to %f\n",speed);
Jog(SPINDLE_AXIS,speed*FACTOR*DirFactor);
break;
:
:

I get movement that starts as soon as enter the rpm and press enter and continues until rpm is set to 0.
With requested 200rpm the true output is 100 rpm, but mach reports something around 1500 (can't remember exactly).
If I start the movement from G-Code/M3 the G-code execution hangs.
Start/accel and stop/decel of movement are nice, as they should.

I changed the above to:

:
:
case EX_SPINSPEED:
printf("Spindle Speed Set to %f\n",speed);
break;

case EX_SPINON:
Jog(SPINDLE_AXIS,speed*FACTOR*DirFactor);
break;
:
:

with this I get
movement that starts when I press spindle start.
With requested 200rpm the true output is 100 rpm, but mach report something around 1500 (can't remember exactly).
If I start the movement from G-Code/M3 the G-code execution hangs.
Start/accel and stop/decel of movement are very rough, with short delay and vibration/jerk like the servo is about to brake into oscillation.

How could I get around this?


I also noticed that in plugin config there is a possibility to specify a external cycle start.

Can this be handled in the init thread in my WatchEnable loop?

If Yes then is there a way to do the Reset button the same way?
I tried the OEMTrigger/HotKey but that doesn't work since I need to read this from the state of the EStop Bit.
My control voltage circuit is set up so that releasing the estop switch does not turn the voltage on.
Control voltage is activated with separate button so I think it is possible/safe to do this if possible.

Turned out a long post but I hope you can bare with me...

Rgds,
Tapio
Group: DynoMotion Message: 7329 From: Tom Kerekes Date: 4/26/2013
Subject: Re: KMotion/Mach3 compatibility Question?
Hi Tapio,

Let's work on one thing at a time.

You should basically be able to use any Version of KMotion with any Version of Mach3.

I think Mach3 043.022 is a pretty good version to use.

I don't know why your resolution is slightly off.  You might have noise causing you to lose/gain encoder counts.  Or it might be mechanical.  Or your specification may be wrong.  You would have to run some experiments to determine which it is.   Basically if it is perfectly consistent with absolutely no drift in position then it is probably not noise.

Regards
TK


Group: DynoMotion Message: 7330 From: tapiolarikka Date: 4/26/2013
Subject: Re: KMotion/Mach3 compatibility Question?
Hi Tom,

I think it is consistent, I cant measure any change or drift after the resolution is set.
There was change between the boots/inits but I'm fairly sure it is related to the flash corruption/Mach/Kflop not responding issue.

There was small problem one axis trying to start at wrong direction as I wrote before but adding offset to output corrected that.

So first two questions are done:
-Should not be a compatibility issue
-I can live with the resolution offset, I'll just make a backup copy
of the setup and write the values down

Rgds,
Tapio

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Tapio,
>
> Let's work on one thing at a time.
>
> You should basically be able to use any Version of KMotion with any Version of Mach3.
>
> I think Mach3 043.022 is a pretty good version to use.
>
> I don't know why your resolution is slightly off.  You might have noise causing you to lose/gain encoder counts.  Or it might be mechanical.  Or your specification may be wrong.  You would have to run some experiments to determine which it is.   Basically if it is perfectly consistent with absolutely no drift in position then it is probably not noise.
>
> Regards
> TK
>
>
>
>
> ________________________________
> From: tapiolarikka <tapio.larikka@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, April 26, 2013 12:02 PM
> Subject: [DynoMotion] KMotion/Mach3 compatibility Question?
>
>
>
>  
> Hi Tom!
>
> I have Kmotion 431C installed and I'm having odd problems with
> Mach3 R3.042.040.
>
> Today I got KFlop twice so corrupted that I had to start from beginning by Flashing new firmware. It appears that if Kflop is not powered up when Mach tries to init, something gets so messed up that have to terminate mach with task manager and reboot in order to try again.
>
> Which KMotion/Plug in I should use with:
> - Mach 042.040?
> - Mach 043.022?
>
> Which Mach3 version should be used with KFlop 431C?
>
> As to the odd problems:
>
> I have 2500ppr encoders with 1:3 reduction and 5mm/rev lead screws on XYZ. I calculate this to be 6000steps/mm on Mach motor tuning but 5920 to 5980steps/mm results in correctly measured move
>
> A-axis/Spindle is angular and has 2560ppr/rev and 1:1 belt.
> I calculate 2560*4/360=28,44444 but testing gives between 37 and 38 to be correct.
>
> Any ideas what might be the cause and cure for this?
>
> After getting the axis moving correctly I tried "SpindleMach3Jog.c".
>
> What should be entered in the plugin config for encoder counts? Encoder ppr or ppr*4?
>
> With 2560 counts/rev and following code:
>
> #include "KMotionDef.h"
>
> //Plugin Notifications and defines..
> enum { EX_DDA , EX_VMS, EX_COMMAND, EX_SPINON, EX_SPINOFF, EX_SPINSPEED, EX_MOTORTUNED
> , EX_SETUP, EX_FEEDHOLD, EX_RUN, EX_ESTOP , EX_CONFIG };
>
> #define SPINDLE_AXIS 3 // axis set up as Spindle, possibly Step/Dir or Servo
> #define FACTOR 10240.0 // Converts fractional pulley speed to counts/sec (may be negative)
>
> main()
> {
> int message = persist.UserData[0]; // Mach3 message ID
> int Direction = persist.UserData[1]; // Mach3 Spindle Direction
> float speed = *(float *)&persist.UserData[2]; // value stored is actually a float
> int DirFactor = 1;
>
> if (Direction==0) DirFactor=-1; // change Direcion 0 or 1 to DirFactor -1 or +1
>
>
> printf("Mach3 Notify Message=%d, Direction=%2d, Spindle Set to %f\n",message,Direction,speed);
>
> switch (message)
> {
> case EX_SPINSPEED:
> printf("Spindle Speed Set to %f\n",speed);
> Jog(SPINDLE_AXIS,speed*FACTOR*DirFactor);
> break;
> :
> :
>
> I get movement that starts as soon as enter the rpm and press enter and continues until rpm is set to 0.
> With requested 200rpm the true output is 100 rpm, but mach reports something around 1500 (can't remember exactly).
> If I start the movement from G-Code/M3 the G-code execution hangs.
> Start/accel and stop/decel of movement are nice, as they should.
>
> I changed the above to:
>
> :
> :
> case EX_SPINSPEED:
> printf("Spindle Speed Set to %f\n",speed);
> break;
>
> case EX_SPINON:
> Jog(SPINDLE_AXIS,speed*FACTOR*DirFactor);
> break;
> :
> :
>
> with this I get
> movement that starts when I press spindle start.
> With requested 200rpm the true output is 100 rpm, but mach report something around 1500 (can't remember exactly).
> If I start the movement from G-Code/M3 the G-code execution hangs.
> Start/accel and stop/decel of movement are very rough, with short delay and vibration/jerk like the servo is about to brake into oscillation.
>
> How could I get around this?
>
> I also noticed that in plugin config there is a possibility to specify a external cycle start.
>
> Can this be handled in the init thread in my WatchEnable loop?
>
> If Yes then is there a way to do the Reset button the same way?
> I tried the OEMTrigger/HotKey but that doesn't work since I need to read this from the state of the EStop Bit.
> My control voltage circuit is set up so that releasing the estop switch does not turn the voltage on.
> Control voltage is activated with separate button so I think it is possible/safe to do this if possible.
>
> Turned out a long post but I hope you can bare with me...
>
> Rgds,
> Tapio
>